package com.ctshk.rpc.order.tour.mapper;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ctshk.rpc.order.tour.req.SeriesOrderTouristVisaDetailReq;
import com.ctshk.rpc.order.tour.req.SeriesOrderTouristVisaListReq;
import org.apache.ibatis.annotations.Param;

/**
 * <p>
 * 系列团游客签证记录 Provider 接口
 * </p>
 *
 * @author 谭响
 * @since 2021-01-18
 */
public class SeriesOrderTouristVisaProvider {


    public String selectListBySelective(IPage<SeriesOrderTouristVisaListReq> pageParam, @Param("req") SeriesOrderTouristVisaListReq req) {
        StringBuilder sb = new StringBuilder();
        sb.append("select ");
        sb.append("tsotv.id, tsotv.order_id, tsotv.tourist_id, " +
                "tsoti.main_data_id, tsoti.tourist_type_name, tsoti.cn_surname, tsoti.cn_name, " +
                "tsotv.visa_amount, tsotv.collection_status, " +
                "tsotv.need_supply_info, tsotv.submit_tracking_number, tsotv.submit_user_id, tsotv.submit_time, " +
                "tsotv.make_up_user_id, tsotv.make_up_time, tsotv.make_up_tracking_number, tsotv.sign_out_status, " +
                "tsotv.sign_out_tracking_number, tsotv.sign_out_time, tsotv.send_time, tsotv.missing_certificate, " +
                "tsotv.advise_submit_time, tsotv.step1_remark, tsotv.step2_remark, tsotv.sign_out_express_time, " +
                "tsotv.sign_out_receipt_file, tsotv.sign_out_files_json ");
        sb.append("from t_series_order_tourist_visa tsotv ");
        sb.append("left join t_series_order_tourist_info tsoti ON tsotv.tourist_id = tsoti.id ");
        sb.append("where 1=1 ");
        sb.append("and tsotv.order_id = #{req.orderId} ");
        return sb.toString();
    }

    public String selectDetailBySelective(@Param("req") SeriesOrderTouristVisaDetailReq req) {
        StringBuilder sb = new StringBuilder();
        sb.append("select ");
        sb.append("tsotv.id, tsotv.order_id, tsotv.tourist_id, " +
                "tsotv.visa_amount, tsotv.collection_status, " +
                "tsotv.need_supply_info, tsotv.submit_tracking_number, tsotv.submit_user_id, tsotv.submit_time, " +
                "tsotv.make_up_user_id, tsotv.make_up_time, tsotv.make_up_tracking_number, tsotv.sign_out_status, " +
                "tsotv.sign_out_tracking_number, tsotv.sign_out_time, tsotv.send_time, tsotv.missing_certificate, " +
                "tsotv.advise_submit_time, tsotv.step1_remark, tsotv.step2_remark, tsotv.sign_out_express_time, " +
                "tsotv.sign_out_receipt_file, tsotv.sign_out_files_json ");
        sb.append("from t_series_order_tourist_visa tsotv ");
        sb.append("where 1=1 ");
        sb.append("and tsotv.order_id = #{req.orderId} ");
        sb.append("and tsotv.tourist_id = #{req.touristId} ");
        return sb.toString();
    }

}
